package com.xiaofan.aspectj;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 晓帆
 * @version 1.0
 **/
@Aspect
@Component
public class MyAspectJ {
    @Pointcut("execution(* com..service..*(..))")
    public void getPointcut(){
    }


    @Around("getPointcut()")
    public Object getAround(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        System.out.println("hello");
        Object proceed = proceedingJoinPoint.proceed();
        System.out.println("world");
        return proceed;

    }
}
